CommandPaste Class Reference

#include <CommandPaste.h>

Inheritance diagram for CommandPaste:

Command List of all members.

Public Member Functions

 CommandPaste (osg::Vec3 pos, OSGWindows *osgwind)
bool execute ()
bool unexecute ()

Private Attributes

OSGWindows * osgwind_
TrafficSign * sign
TrafficLight * light
Vehicle * vehicle
EnvironmentObject * envObj
vector< TraffEduObject * > pastedObjs_
vector< TraffEduObject * > tmpObjs_
char whichVector

Detailed Description

Definition at line 7 of file CommandPaste.h.


Constructor & Destructor Documentation

CommandPaste::CommandPaste (  osg::Vec3  pos,
OSGWindows *  osgwind
) 
 

A constructor. Initializes osgwind_ and creates the pasted objects.

Parameters:
pos a osg::Vec3 argument.
osgwind an OSGWindows pointer.

Definition at line 2 of file CommandPaste.cpp.

References OSGWindows::addObject(), OSGWindows::getCopiedObjects(), OSGWindows::getCutObjects(), TraffEduObject::getObjectGroup(), osgwind, osgwind_, pastedObjs_, TraffEduObject::setPosition(), TraffEduObject::setScale(), sign, SIGN, tmpObjs_, and whichVector.


Member Function Documentation

bool CommandPaste::execute (   )  [virtual]
 

do the paste operation.

Returns:
Operation success

Implements Command.

Definition at line 73 of file CommandPaste.cpp.

References OSGWindows::doAddGeode(), osgwind_, and pastedObjs_.

bool CommandPaste::unexecute (   )  [virtual]
 

undo the paste operation.

Returns:
Operation success

Implements Command.

Definition at line 87 of file CommandPaste.cpp.

References OSGWindows::doDeleteGeode(), osgwind_, pastedObjs_, OSGWindows::setCutObjects(), and whichVector.


Member Data Documentation

EnvironmentObject* CommandPaste::envObj [private]
 

a private variable. It is used to hold the created environmental object by using the pasted object information.

Definition at line 39 of file CommandPaste.h.

TrafficLight* CommandPaste::light [private]
 

a private variable. It is used to hold the created traffic light object by using the pasted object information.

Definition at line 27 of file CommandPaste.h.

OSGWindows* CommandPaste::osgwind_ [private]
 

a private variable. It is initialized with the unique OSGWindows instance.

Definition at line 15 of file CommandPaste.h.

Referenced by CommandPaste(), execute(), and unexecute().

vector<TraffEduObject*> CommandPaste::pastedObjs_ [private]
 

a private vector of TraffEduObjects. It holds the pasted objects.

Definition at line 45 of file CommandPaste.h.

Referenced by CommandPaste(), execute(), and unexecute().

TrafficSign* CommandPaste::sign [private]
 

a private variable. It is used to hold the created traffic sign object by using the pasted object information.

Definition at line 21 of file CommandPaste.h.

Referenced by CommandPaste().

vector<TraffEduObject*> CommandPaste::tmpObjs_ [private]
 

a private vector of TraffEduObjects. It holds the copied or cut objects beforehand.

Definition at line 51 of file CommandPaste.h.

Referenced by CommandPaste().

Vehicle* CommandPaste::vehicle [private]
 

a private variable. It is used to hold the created vehicle object by using the pasted object information.

Definition at line 33 of file CommandPaste.h.

char CommandPaste::whichVector [private]
 

a private variable. It is used to show from which vector the pasted objects are coming(copied or cut).

Definition at line 57 of file CommandPaste.h.

Referenced by CommandPaste(), and unexecute().


The documentation for this class was generated from the following files:
Generated on Sun May 28 18:54:12 2006 for TraffEdu by  doxygen 1.4.6-NO